-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow overwriting part names #20
base: master
Are you sure you want to change the base?
Conversation
Also thanks for the PR and trying to resolve this, but there are two issues with this approach.
|
Part variations require to keep separate stock, which is good idea in many cases, but not desired in every case
I'm not sure if I understand you correctly here, but in my understanding this is exactly what the PR does. It creates one part, with a user-assigned name, and creates supplier- and manufacturer-parts (with different search-terms) for that part
Yes, but the goal of this PR is to allow overriding this behaviour, to provide the aforementioned functionality as part of the script
No, it serves a different purpose. Currently, |
I agree though that the naming scheme might not be ideal here. Maybe |
Maybe. This might work for newly created parts. But it won't for already existing ones, because I search for existing Supplier/Manufacturer parts first and if they exists, just use them (and the part linked to them). So this could easily result in name clashes (because we'd be trying to rename another part to an existing name then).
Still, the whole override could (and should) be done only in the |
I think I had a similar situation in the past actually, where two different suppliers used slightly different MPNs for the same part. So I ended up with two parts, manufacturer parts and supplier parts each. The way I resolved this was by manually linking all the supplier parts to the same manufacturer part. And then deleting the duplicate manufacturer part and part. (I did this manually via the InvenTree UI). Maybe an approach like this would be better here. Basically a separate mode to |
Ah, true. Agreed. I think I didn't do it that way because of the nested structure of the calls that create the necessary parts, as api_part is already passed through to all functions.
I like that approach a lot. That would also allow doing this in hindsight, which is better from a usability perspective.
A sensible approach here could be to always confirm deletions, e.g. by asking "this would delete parts xyz ... are you sure?" |
Cool, then let's go with that! I'll try to find some time to throw together an implementation the next few days.
Yeah, I think I'll go for only marking the parts as "inactive" + a config option to enable automatic deleting + an "are you sure?" prompt, listing everything that's going to be deleted. Better be safe than sorry. |
cb0116f
to
22ff740
Compare
Summary
This PR adds functionality to overwrite part names associated to supplier/manufacturer parts.
Problem
In some cases, parts can have multiple different manufacturers and MPNs, but are essentially the same. For example, there is a multitude of 10-pin 2.54mm 2x5 shrouded headers, which for almost all intents and purposes are identical.
For items like these, it does not make sense to keep seperate stock or even treat them differently in any way. However, currently
inventree-part-import
does not support such a scenario.Description
This PR adds functionality to overwrite part names associated to supplier/manufacturer parts. With this, it's possible to store multiple similar supplier/manufacturer into the same part.
For example,
will store multiple of the aforementioned headers into the same part,
Header-254-16P-S
. This keeps the parts minimal, allows keeping one stock item for all different supply/manufacturer parts and in general simplifies handling.